<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>闪电秒杀-欢迎登录</title>
    <link rel="stylesheet" href="../css/login.css">
    <script src="https://code.jquery.com/jquery-3.6.1.min.js"></script>
    <!--    引入md5工具-->
    <script src="https://cdn.bootcss.com/blueimp-md5/2.10.0/js/md5.min.js"></script>
</head>

<body>
<!-- 账户登录 -->

<!-- 顶部 -->
<div id="w">
    <!-- 1.左侧logo区域 -->
    <div class="logo">
        <a href="../index.html/resources/static/index.html">
            <img src="../images/shandianmiaosha_logo.png" width="170" height="60">
        </a>
        <b></b>
    </div>

    <!-- 2.右侧调查问卷区域 -->
    <div class="words">
        <a href="https://wj-dongjian.jd.com/q/61a05143f2ec2b00b35e40a6">
            <c></c>
            <d>登录页面，调查问卷</d>
        </a>
    </div>
</div>

<!-- 横条 -->
<div id="tip">
    <!-- logo -->
    <img src="../images/!_logo.png" style="width: 20px; height: 20px;margin-top: 8px;margin-bottom: 14px; position: absolute; left: 520px; float: left;">

    <!-- 文字 -->
    <div class="tip-word">
        <p>依据《网络安全法》，为保障您的账户安全和正常使用，请尽快完成手机号验证！</p>
    </div>
</div>

<!-- 中部 -->
<div id="content">
    <div class="content-picture">
        <div class="login">

            <!-- (1)横条 -->
            <div class="login-top">
                <img src="../images/!_logo.png" style="width: 20px; height: 20px;margin-top: 8px;margin-bottom: 14px; position: absolute; left: 10px; float: left;">
                <!-- 文字 -->
                <div class="words">
                    <a>闪电秒杀不会以任何理由要求您转账汇款，谨防诈骗。</a>
                </div>
            </div>

            <!-- (2)“登录”-->
            <div class="acc">
                <a href="regist.jsp">
                    <div class="regist">
                        <span>账户注册</span>
                    </div>
                </a>

                <div class="login">
                    <span>账户登录</span>
                </div>

            </div>

            <form action="">
                <!-- (3) 输入框 -->
                <input type="text" placeholder="请输入手机号码" class="telno">
                <span class="telno-must"></span>
                <input type="password" placeholder="请输入密码" class="psw">
                <span class="psw-must"></span>
                <!-- (4)登录按钮 -->
                <input type="submit" value="登   录" class="loginBtn">
            </form>

            <!-- (5)wx,qq,跳过 -->
            <div class="login-logo">
<%--                <div class="wx">--%>
<%--                    <img src="../images/weixin.png" style="height: 24px;width: 24px; line-height: 100%; text-align: left; position: absolute;left: 17px; top: 14px;">--%>
<%--                    <a href="https://open.weixin.qq.com/connect/qrconnect?appid=wx827225356b689e24&state=28585CC6252586BE18F84B6DA28F472FF5923023A93C2CA00E51889C18611A58E3C3C98DA91366291EE6C3C337DE6C37&redirect_uri=https%3A%2F%2Fqq.jd.com%2Fnew%2Fwx%2Fcallback.action%3Fview%3Dnull%26uuid%3Dc90e55486eb345cca7f3c7ee17079b7f&response_type=code&scope=snsapi_login#wechat_redirect"><span>微信</span></a>--%>
<%--                </div>--%>

<%--                <div class="qq">--%>
<%--                    <img src="../images/qq2.png" style="height: 23px;width: 23px; line-height: 100%; text-align: left; position: absolute;left: 10px; top: 14px;">--%>
<%--                    <a href="https://graph.qq.com/oauth2.0/show?which=Login&display=pc&response_type=code&state=6FB7D8E4F21DB3C9E26AD0CB5A0F6FAC74B8B633879FBE5FD62DE2D1F1B6888397FFF44FFD3BB395A5376CE97C8E1FA6&client_id=100273020&redirect_uri=https%3A%2F%2Fqq.jd.com%2Fnew%2Fqq%2Fcallback.action%3Fview%3Dnull%26uuid%3De8a105e4adc34132a8265a937744a6e2"><span>qq</span></a>--%>
<%--                </div>--%>

                <div class="pass">
                    <img src="../images/next.png" style="height: 24px;width: 24px; line-height: 100%; text-align: left; position: absolute;left: 2px; top: 14px;">
                    <a href="../index.jsp">
                        <span>跳过</span>
                    </a>
                </div>
            </div>

        </div>
    </div>
</div>

<!-- 底部 -->
<div class="bottom">
    <a>Copyright © 2004-2022  京东JD.com 版权所有</a>
</div>
<script src="../js/login.js"></script>
<script>
    $(".loginBtn").click(function (){
        var userPwd1=$(".psw").val();
        userPwd=md5(userPwd1)
        // console.log("前段加过密的密码:"+userPwd)
        $.ajax({
            type:"POST",
            url:"${pageContext.request.contextPath}/users/login",
            data:{
                userTelno:$(".telno").val(),
                userPwd:md5(userPwd1)
            },
            success:function (data){
                console.log( data)
                if(data==""){
                    alert("登录失败，请重试")
                    window.location.href="${pageContext.request.contextPath}/personal/login.jsp"
                }else{
                    var token=data
                    alert("欢迎你，登录成功")
                    localStorage.setItem("token",token)
                    window.location.href="${pageContext.request.contextPath}/index.jsp"
                }

            }
        })
    })
</script>
</body>
</html>
